import axios from 'axios';
/* 
封装axios
*/
const http = axios.create({
    timeout: 1000 * 30,
    // baseURL: "http://124.71.219.15:8084/blog_system/",
    //long
    // baseURL: "http://172.20.19.45:8888/blog_system/",
    // baseURL: "http://192.168.56.2:8888/blog_system/",
    //wu
    // baseURL: "http://172.20.10.12:8888/blog_system/",
    baseURL: "http://192.168.137.1:8888/blog_system/",
    withCredentials: true,
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
    },
})
/* 请求拦截*/
http.interceptors.request.use(
    config => {
        //这里判断本地是否存储了token
        if (sessionStorage.getItem('LoginToken')) {
            config.headers.Authorization = sessionStorage.getItem("LoginToken");
        }

        return config;
    }
)

export default http